import request from '@/utils/request'

// 添加菜品到购物车
export function addToCart(dishName, dishPrice, userId) {
  return request({
    url: '/shop/insert',
    method: 'get',
    params: { dishname: dishName, dishprice: dishPrice, userid: userId }
  })
}

// 获取用户购物车
export function getCart(userId) {
  return request({
    url: '/shop/show',
    method: 'get',
    params: { userid: userId }
  })
}

// 更新购物车商品数量
export function updateCartQuantity(sign, shopId) {
  return request({
    url: '/shop/update',
    method: 'post',
    params: { sign, shopid: shopId }
  })
} 